#!/usr/bin/env python
import fileinput,time

class  File:
    def read(self,Filename):
        with open(Filename, 'r') as Mes:
            return Mes.readlines()

    def fileinput(self,filename,old,new):
        Today_time=time.strftime("%Y%m%d%H%M%S",time.localtime())
        for line in fileinput.input(filename,backup='-%s'%Today_time,inplace=1):
            print line.rstrip().replace(old,new)
    def add(self,Filename,addMes):
        with open(Filename,'a+') as Mes:
            Mes.write(addMes)
    def write(self,Filename,addMes):
        with open(Filename,'w') as Mes:
            Mes.write(addMes)
